public class Interval
{
   private double lower;
   private double upper;

   /**
      Constructs an open interval.
      @param aLowerBound the lower bound
      @param anUpperBound the upper bound
   */
   public Interval(double aLowerBound, double anUpperBound)
   {
      lower = aLowerBound;
      upper = anUpperBound;
   }

   /**
      Checks whether a value is contained in the interval.
      @param x a value
      @return true if x is contained in the interval
   */
   public boolean contains(double x)
   {
      return lower < x && x < upper;
   }

   /**
      Gets the lower bound of this interval.
      @return the lower bound
   */
   public double getLower()
   {
      return lower;
   }

   /**
      Gets the lower bound of this interval.
      @return the lower bound
   */
   public double getUpper()
   {